package smartfleet.mobile;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class initial extends Activity{

	private EditText mID;
	private EditText mNetPort;
	private EditText mEmulPort;
	private EditText mSimAddr;
	private EditText mSimPort;
	private EditText mStation;
	private EditText mBattery;
	
	@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.initial);
        setTitle("Insert information");
        
        Button confirmButton = (Button) findViewById(R.id.confirm);
        
        mID = (EditText) findViewById(R.id.id_text);
        mNetPort = (EditText) findViewById(R.id.netport_text);
        mEmulPort = (EditText) findViewById(R.id.emulport_text);
        mSimAddr = (EditText) findViewById(R.id.sim_address);
        mSimPort = (EditText) findViewById(R.id.sim_port);
        mStation = (EditText) findViewById(R.id.station_text);
        mBattery = (EditText) findViewById(R.id.battery_text);
                
        confirmButton.setOnClickListener(new View.OnClickListener() {

            public void onClick(View view) {
                Bundle bundle = new Bundle();

                bundle.putString("id", mID.getText().toString());
                bundle.putString("netport", mNetPort.getText().toString());
                bundle.putString("emulport", mEmulPort.getText().toString());
                bundle.putString("sim_addr", mSimAddr.getText().toString());
                bundle.putString("sim_port", mSimPort.getText().toString());
                bundle.putString("station_id", mStation.getText().toString());
                bundle.putString("battery", mBattery.getText().toString());
                
                Intent mIntent = new Intent();
                mIntent.putExtras(bundle);
                setResult(RESULT_OK, mIntent);
                finish();
            }
        });
	}
}